package com.xianggu.demo.controller;


import com.xianggu.demo.dto.UserDto;
import com.xianggu.spring.annotation.*;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author chengjy
 * @date 2025/3/5
 */
@RequestMapping("/666")
@Controller
@ResponseBody
public class UserController {
    @GetMapping("/userName")
    public String userInfo(String userName) {
        return "香菇是个大坏蛋！ \r\n            --"+ userName;
    }
    @GetMapping("/userName2")
    public String userInfo2(@RequestParam("userName") String userName , @RequestParam("date") String date) {
        return "香菇是个大坏蛋！ \r\n            --"+ userName + " " + date;
    }
    @GetMapping("/test")
    public String test(@RequestBody UserDto userDto) {
        return "test 方法执行！" + userDto;
    }
}
